<table class="table table-bordered">
    <colgroup>
        <col style="width: 20%;"></col>
        <col style="width: 80%;"></col>
    </colgroup>

    <tr>
        <th class="th-label">玩家ID</th>
        <td>
            <{$data.SellRoleID}>
            <input type="hidden" name="roleID" value="<{$data.SellRoleID}>" />
        </td>
    </tr>
    <tr>
        <th class="th-label">订单ID</th>
        <td>
            <{$data.RecordItemId}>
            <input type="hidden" name="recordItemID" value="<{$data.RecordItemId}>" />
        </td>
    </tr>
    <tr>
        <th class="th-label">扣除规则</th>
        <td>
            <label><input type="radio" name="cut-type" class="cut-type" value="1" checked/> 按市场价格扣除</label>
            <label><input type="radio" name="cut-type" class="cut-type" value="2"/> 全部扣除</label>
        </td>
    </tr>
    <tr>
        <th class="th-label">市场价格</th>
        <td>
            <{$data.TradeRecPrice}>
            <input type="hidden" name="recPrice" value="<{$data.TradeRecPrice}>" />
        </td>
    </tr>
    <tr>
        <th class="th-label">应获得石币</th>
        <td>
            <span class="span-getStone"><{$data.TradeRecPrice*$data.TradeItemNum}></span>
            <input type="hidden" name="getStone" value="<{$data.TradeRecPrice*$data.TradeItemNum}>" />
        </td>
    </tr>
    <tr>
        <th class="th-label">扣除石币</th>
        <td>
            <span class="span-deductionStone"><{$data.TradeTurnover-$data.TradeRecPrice*$data.TradeItemNum}></span>
            <input type="hidden" name="deductionStone" value="<{$data.TradeTurnover-$data.TradeRecPrice*$data.TradeItemNum}>" />
        </td>
    </tr>
</table>

<script>
    $(function(){
        var num = '<{$data.TradeItemNum}>',
            price = '<{$data.TradeRecPrice}>',
            turnover = '<{$data.TradeTurnover}>';

        $("input:radio[name='cut-type']").change(function(){
            if($("[name='cut-type']:checked").val() == '1'){
                var getStone = price * num;
                var deductionStone = turnover - getStone;
            }else{
                var getStone = 0;
                var deductionStone = turnover;
            }

            $(".span-getStone").html(getStone);
            $("[name='getStone']").val(getStone);
            $(".span-deductionStone").html(deductionStone);
            $("[name='deductionStone']").val(getStone);
        });
        var getStone = num * price;
    });
</script>